package com.huoyun.car.bean;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class CarPubInfo {
	
	private Long id;

	private Date starttime;

	private Date endtime;

	private String loadAmount;

	private String unit;

	private String urgentContact;
	
	private String defaultContact;

	private int retour;
	
	private long userId;
	
	private long carId;
	
	private int type;
	
	private String otherInfo;
	
	private int status;
	
	private Date addTime;
	
	private List<CarRoute> carRouteList;
	
	public String getDefaultContact() {
		return defaultContact;
	}

	public void setDefaultContact(String defaultContact) {
		this.defaultContact = defaultContact;
	}
	
    public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public long getCarId() {
		return carId;
	}

	public void setCarId(long carId) {
		this.carId = carId;
	}

	/**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column _car_pub_info.id
     *
     * @return the value of _car_pub_info.id
     *
     * @mbggenerated
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column _car_pub_info.id
     *
     * @param id the value for _car_pub_info.id
     *
     * @mbggenerated
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column _car_pub_info.starttime
     *
     * @return the value of _car_pub_info.starttime
     *
     * @mbggenerated
     */
    public Date getStarttime() {
        return starttime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column _car_pub_info.starttime
     *
     * @param starttime the value for _car_pub_info.starttime
     *
     * @mbggenerated
     */
    public void setStarttime(Date starttime) {
        this.starttime = starttime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column _car_pub_info.endtime
     *
     * @return the value of _car_pub_info.endtime
     *
     * @mbggenerated
     */
    public Date getEndtime() {
        return endtime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column _car_pub_info.endtime
     *
     * @param endtime the value for _car_pub_info.endtime
     *
     * @mbggenerated
     */
    public void setEndtime(Date endtime) {
        this.endtime = endtime;
    }

	public String getLoadAmount() {
		return loadAmount;
	}

	public void setLoadAmount(String loadAmount) {
		this.loadAmount = loadAmount;
	}

	/**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column _car_pub_info.unit
     *
     * @return the value of _car_pub_info.unit
     *
     * @mbggenerated
     */
    public String getUnit() {
        return unit;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column _car_pub_info.unit
     *
     * @param unit the value for _car_pub_info.unit
     *
     * @mbggenerated
     */
    public void setUnit(String unit) {
        this.unit = unit == null ? null : unit.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column _car_pub_info.urgent_contact
     *
     * @return the value of _car_pub_info.urgent_contact
     *
     * @mbggenerated
     */
    public String getUrgentContact() {
        return urgentContact;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column _car_pub_info.urgent_contact
     *
     * @param urgentContact the value for _car_pub_info.urgent_contact
     *
     * @mbggenerated
     */
    public void setUrgentContact(String urgentContact) {
        this.urgentContact = urgentContact == null ? null : urgentContact.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column _car_pub_info.retour
     *
     * @return the value of _car_pub_info.retour
     *
     * @mbggenerated
     */
    public int getRetour() {
        return retour;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column _car_pub_info.retour
     *
     * @param retour the value for _car_pub_info.retour
     *
     * @mbggenerated
     */
    public void setRetour(int retour) {
        this.retour = retour;
    }

	public String getStarttimeStr() {
		return new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm").format(starttime);
	}
	
	public void setStarttimeStr(String starttimeStr) {
		DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		try {
			this.starttime = format.parse(starttimeStr);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


	public String getEndtimeStr() {
		return new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm").format(endtime);
	}
	
	public void setEndtimeStr(String endtimeStr) {
		DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		try {
			this.endtime = format.parse(endtimeStr);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getOtherInfo() {
		return otherInfo;
	}

	public void setOtherInfo(String otherInfo) {
		this.otherInfo = otherInfo;
	}

	public List<CarRoute> getCarRouteList() {
		return carRouteList;
	}

	public void setCarRouteList(List<CarRoute> carRouteList) {
		this.carRouteList = carRouteList;
	}

}